<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../js/dojotoolkit/dojo/dojo.js"></script>
        <script type="text/javascript" src="../js/format/xml2json.js"></script>
		<script type="text/javascript">
			//@todo change dojo xhrget to pure javascript ajax
            function getWebSolutionLastValues(xmlUrl){
                var result = "";
                var xhrArgs = {
                    url:xmlUrl,
                    handleAs:"text",
                    sync:true,  //must to sync, or result can't get value;
                    load:function(data){                        
                       result = xml2json.parser(data);
                    },
                    error:function(er){
                        alert("xml file reading error:"+er);
                    }

                };
                dojo.xhrGet(xhrArgs);
                return result;
            }
            
            myjsons = getWebSolutionLastValues("xml.xml");
            //alert(myjsons);
            alert("MeterData.ID:"+myjsons.MeterData.ID+";MeterData.Timestamp:"+myjsons.MeterData.Timestamp);
            //alert(myjsons.meterdata.id);
        </script>
    </head>
    <body>

    </body>
</html>
